#!/usr/bin/env/ python
# -*- coding: utf-8 -*-

"""
@author: super
@software: PyCharm
@file: 03_new_pymysql查询语句操作
@time: 2021/11/10 10:20
"""

import pymysql

if __name__ == '__main__':
    conn = pymysql.connect(host= "localhost", port= 3306, user= "root", password= "root", database= "flask", charset= "utf8")

    cursor = conn.cursor()

    sql = "SELECT * FROM `user`;"

    row_number = cursor.execute(sql)

    for item in cursor.fetchall():
        print(item)

    cursor.close()

    conn.close()
